package com.example.academicsystem.server.controller.course;

import com.example.academicsystem.pojo.dto.CourseDto;
import com.example.academicsystem.result.PageResult;
import com.example.academicsystem.result.Result;
import com.example.academicsystem.server.service.CourseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/course")
@Slf4j
public class CourseController {
    @Autowired
    private CourseService courseService;

    @PostMapping("/page")
    public Result<PageResult> coursePageQuery(@RequestBody CourseDto courseDto){
        log.info("coursePageQuery");
        PageResult pageResult =courseService.coursePageQuery(courseDto);
        return Result.success(pageResult);
    }
}
